#-*- coding: utf8 -*-
from tutor.scripts import *
from tutor.plugins.maple import *

# variáveis úteis
half = M('1/2')
t = M.t
_i, _j, _k = M('_i, _j, _k')
rr = M('`..`')
coeff = M.coeff

# parâmetros iniciais
with display_block('Entradas'):
    k = M(oneof(1, -1)) * oneof(1, 5) / 4 / oneof(1, 2, 3)
    c2 = M(oneof(-2, -1, 1, 1, 1, 2, 3))
    c4 = M(oneof(-2, -1, 1, 1, 1, 2, 3))
    e0 = M('epsilon[0]')

    # parametros derivados
    c1 = k / 3
    c5 = c1
    c3 = c1 - c2 / 3
    c6 = c4

    # campo
    fieldF = (c1 * x ** 3 + c2 * x * y ** 2) * _i + \
             (c3 * y ** 3 + c4 * M.exp(y) * M.sin(z)) * _j + \
             (c5 * z ** 3 + c6 * M.exp(y) * M.cos(z)) * _k

# --- resultados --------------------------------------------------------------
with display_block('Resultados'):
    carga = 124 * Pi * k / 5 * e0
    limite1 = 4 * Pi * k / 5 * e0
    limite2 = 128 * Pi * k / 5 * e0
    jacobiano = 14 * Pi ** 2 * k / 3 * e0
    rotacional = 0
    distrator = 32 * Pi ** 2 * k / 5 * e0


